import httpService from '../request'
import type { BaseResponse } from '@/types/request'
import type { UserLoginReqData, UserInfo } from '@/types/user'

// 登录
export function login (data: UserLoginReqData): Promise<BaseResponse<string>> {
  return httpService.request<BaseResponse<string>>({
    url: '/v1/api/login',
    data, method: 'post'
  })
}

// 用户信息
export function userInfo (): Promise<BaseResponse<UserInfo>> {
  return httpService.request<BaseResponse<UserInfo>>({
    url: '/v1/api/user/info'
  })
}
